package com.xzm.project.ui.activity;

import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.allen.library.SuperTextView;
import com.xzm.project.R;
import com.xzm.project.annotation.AnnotationCar;
import com.xzm.project.annotation.MyTag;
import com.xzm.project.ui.bean.Car;
import com.xzm.project.ui.widget.CircleBarView;

import cn.wuyu.baselibrary.utils.ToastUtil;

public class MyViewActivity extends AppCompatActivity {
    @MyTag(name = "BMW",size = 100)
    Car car;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_view);
        init();
    }

    private void init() {
        CircleBarView circleBarView = findViewById(R.id.circleBarView);
//        circleBarView.setTranslationY();
        circleBarView.setProgressNum(20,3000);
        SuperTextView superTextView = findViewById(R.id.superTextView);
        LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) superTextView.getCenterBottomTextView().getLayoutParams();
        params.leftMargin=30;
        //这里我们要首先注册一下这个类
        AnnotationCar.instance().inject(this);
        //当程序运行的时候这里将会输出该类Car的属性值。
        Log.e("WANG","Car is "+car.toString());
        superTextView.setOnClickListener(v -> {
            ToastUtil.showTest("1111111111");
        });
//        superTextView.setOnSuperTextViewClickListener()
    }


    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        return super.dispatchTouchEvent(ev);
    }
//    @Override
//    public void onUserInteraction() {
//        super.onUserInteraction();
//    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return super.onTouchEvent(event);
    }


}
